package com.example.common.feign;

import com.example.common.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;

@FeignClient(name = "payment-service", fallback = PaymentFeignClientFallback.class)
public interface PaymentFeignClient {
    
    @GetMapping("/api/payment/{id}")
    R getPayment(@PathVariable("id") Long id);
    
    @GetMapping("/api/payment/order/{orderNo}")
    R getPaymentByOrderNo(@PathVariable("orderNo") String orderNo);
    
    @PostMapping("/api/payment/pay")
    R pay(@RequestParam("orderNo") String orderNo, @RequestParam("userId") Long userId, @RequestParam("amount") BigDecimal amount);
}
